Original Data (not normalized on CD42b)

Read Data

sce <- readRDS(file.path(path_to_data, "sce_original_RPs_MPs.rds"))

sce_b <- subset_sce(sce, "activation", "baseline")
sce_a <- subset_sce(sce, "activation", "stimulated")

de_res_b <- readRDS(file.path(path_to_data, "de_results_baseline_original.rds"))
de_res_a <- readRDS(file.path(path_to_data, "de_results_stimulated_original.rds"))

Marker Distributions

Baseline level

State Markers

features <- "state"
activation <- "baseline"
plot_marker_distributions(sce_b, features, activation)
## [[1]]

## 
## [[2]]

## 
## [[3]]

Type Markers

features <- "type"
activation <- "baseline"
plot_marker_distributions(sce_b, features, activation)
## [[1]]

## 
## [[2]]

## 
## [[3]]

TRAP stimulated level

State Markers

features <- "state"
activation <- "stimulated"
plot_marker_distributions(sce_a, features, activation)
## [[1]]

## 
## [[2]]

## 
## [[3]]

Type Markers

features <- "type"
activation <- "stimulated"
plot_marker_distributions(sce_a, features, activation)
## [[1]]

## 
## [[2]]

## 
## [[3]]

Dimensionality Reduction

Baseline

perform_and_plot_DR(sce_b)
## [[1]]

## 
## [[2]]

## 
## [[3]]

## 
## [[4]]

TRAP Stimulated

perform_and_plot_DR(sce_b)
## [[1]]

## 
## [[2]]

## 
## [[3]]

## 
## [[4]]

DE Results

Paired t-test

Baseline RPs vs. MPs

# sce subset 
# nach subgroup kopieren?
plotDiffHeatmapCustom(x = sce_b,
                      y = de_res_b$t_test,
                      col_anno = c("subgroup", "patient_id"),
                      k = "all",
                      top_n = 20,
                      fdr = 0.05,
                      lfc = 1,
                      all = TRUE,
                      eff_r = de_res_b$effect_size,
                      sort_by = "padj",
                      assay = "exprs",
                      fun = "median",
                      normalize = TRUE
                      )

print_DE_top_table(sce_b, de_res_b, method = "t_test")

Stimulated RPs vs. MPs

plotDiffHeatmapCustom(x = sce_a,
                      y = de_res_a$t_test,
                      col_anno = c("subgroup", "patient_id"),
                      k = "all",
                      top_n = 20,
                      fdr = 0.05,
                      lfc = 1,
                      all = TRUE,
                      eff_r = de_res_a$effect_size,
                      sort_by = "padj",
                      assay = "exprs",
                      fun = "median",
                      normalize = TRUE
                      )

print_DE_top_table(sce_a, de_res_a, method = "t_test")

CyEMD

Baseline RPs vs. MPs

plotDiffHeatmapCustom(x = sce_b,
                      y = de_res_b$CyEMD,
                      top_n = 20,
                      fdr = 0.05,
                      col_anno = c("subgroup", "patient_id"),
                      k = "all",
                      lfc = 1,
                      all = TRUE,
                      eff_r = de_res_b$effect_size,
                      sort_by = "padj",
                      assay = "exprs",
                      fun = "median",
                      normalize = TRUE
                      )

print_DE_top_table(sce_b, de_res_b, method = "CyEMD")

Stimulated RPs vs. MPs

plotDiffHeatmapCustom(x = sce_a,
                      y = de_res_a$CyEMD,
                      col_anno = c("subgroup", "patient_id"),
                      k = "all",
                      top_n = 20,
                      fdr = 0.05,
                      lfc = 1,
                      all = TRUE,
                      eff_r = de_res_a$effect_size,
                      sort_by = "padj",
                      assay = "exprs",
                      fun = "median",
                      normalize = TRUE
                      )

print_DE_top_table(sce_a, de_res_a, method = "CyEMD")

DE Comparison

Baseline RPs vs. MPs

createVennHeatmap(de_res_b)

Activated RPs vs. MPs

createVennHeatmap(de_res_a)

Normalized Data (on CD42b)

Read Data

sce <- readRDS(file.path(path_to_data, "sce_CD42b_RPs_MPs.rds"))

sce_b <- subset_sce(sce, "activation", "baseline")
sce_a <- subset_sce(sce, "activation", "stimulated")

de_res_b <- readRDS(file.path(path_to_data, "de_results_baseline_CD42b.rds"))
de_res_a <- readRDS(file.path(path_to_data, "de_results_stimulated_CD42b.rds"))

Marker Distributions

Baseline level

State Markers

features <- "state"
activation <- "baseline"
plot_marker_distributions(sce_b, features, activation)
## [[1]]

## 
## [[2]]

## 
## [[3]]

Type Markers

features <- "type"
activation <- "baseline"
plot_marker_distributions(sce_b, features, activation)
## [[1]]

## 
## [[2]]

## 
## [[3]]

TRAP stimulated level

State Markers

features <- "state"
activation <- "stimulated"
plot_marker_distributions(sce_a, features, activation)
## [[1]]

## 
## [[2]]

## 
## [[3]]

Type Markers

features <- "type"
activation <- "stimulated"
plot_marker_distributions(sce_a, features, activation)
## [[1]]

## 
## [[2]]

## 
## [[3]]

Dimensionality Reduction

Baseline

perform_and_plot_DR(sce_b)
## [[1]]

## 
## [[2]]

## 
## [[3]]

## 
## [[4]]

TRAP Stimulated

perform_and_plot_DR(sce_a)
## [[1]]

## 
## [[2]]

## 
## [[3]]

## 
## [[4]]

DE Results

Paired t-test

Baseline RPs vs. MPs

# sce subset 
# nach subgroup kopieren?
plotDiffHeatmapCustom(x = sce_b,
                      y = de_res_b$t_test,
                      col_anno = c("subgroup", "patient_id"),
                      k = "all",
                      top_n = 20,
                      fdr = 0.05,
                      lfc = 1,
                      all = TRUE,
                      eff_r = de_res_b$effect_size,
                      sort_by = "padj",
                      assay = "exprs",
                      fun = "median",
                      normalize = TRUE
                      )

print_DE_top_table(sce_b, de_res_b, method = "t_test")

Stimulated RPs vs. MPs

plotDiffHeatmapCustom(x = sce_a,
                      y = de_res_a$t_test,
                      col_anno = c("subgroup", "patient_id"),
                      k = "all",
                      top_n = 20,
                      fdr = 0.05,
                      lfc = 1,
                      all = TRUE,
                      eff_r = de_res_a$effect_size,
                      sort_by = "padj",
                      assay = "exprs",
                      fun = "median",
                      normalize = TRUE
                      )

print_DE_top_table(sce_a, de_res_a, method = "t_test")

CyEMD

Baseline RPs vs. MPs

plotDiffHeatmapCustom(x = sce_b,
                      y = de_res_b$CyEMD,
                      top_n = 20,
                      fdr = 0.05,
                      col_anno = c("subgroup", "patient_id"),
                      k = "all",
                      lfc = 1,
                      all = TRUE,
                      eff_r = de_res_b$effect_size,
                      sort_by = "padj",
                      assay = "exprs",
                      fun = "median",
                      normalize = TRUE
                      )

print_DE_top_table(sce_b, de_res_b, method = "CyEMD")

Stimulated RPs vs. MPs

plotDiffHeatmapCustom(x = sce_a,
                      y = de_res_a$CyEMD,
                      col_anno = c("subgroup", "patient_id"),
                      k = "all",
                      top_n = 20,
                      fdr = 0.05,
                      lfc = 1,
                      all = TRUE,
                      eff_r = de_res_a$effect_size,
                      sort_by = "padj",
                      assay = "exprs",
                      fun = "median",
                      normalize = TRUE
                      )

print_DE_top_table(sce_a, de_res_a, method = "CyEMD")

DE Comparison

Baseline RPs vs. MPs

createVennHeatmap(de_res_b)

Activated RPs vs. MPs

createVennHeatmap(de_res_a)